<template>
	<view>
		<u-cell-group title="基本信息:">
			<u-cell title="项目编号名称" :label="mydata.Name"></u-cell>
			<u-cell title="项目编号" :label="mydata.No"></u-cell>
			<u-cell title="市场分类" :label="mydata.MarketType"></u-cell>
			<u-cell title="项目用途" :label="mydata.Usefor"></u-cell>
			<u-cell title="立项人" :label="mydata.Initpeople"></u-cell>
			<u-cell title="所属部门" :label="mydata.Dept.Name||''"></u-cell>
			<u-cell title="项目预算收入(万元)" :label="mydata.BudgetIncome"></u-cell>
			<u-cell title="工程实施公司" :label="mydata.BuildCompany"></u-cell>
			<u-cell title="项目摘要" :label="mydata.Summary"></u-cell>
			<u-cell title="立项人" :label="mydata.Initpeople"></u-cell>
		</u-cell-group>
		<!-- <u--text text="项目立项可行性方案"></u--text> -->
		<u-cell-group title="项目立项可行性方案:">
			<u-cell title="业主单位" :label="mydata.Owner"></u-cell>
			<u-cell title="项目经理" :label="mydata.ProjManager"></u-cell>
			<u-cell title="项目经理电话" :label="mydata.ProjManagerPhone"></u-cell>
			<u-cell title="项目合同金额(万元)" :label="mydata.ContractMoney"></u-cell>
			<u-cell title="项目合同期（月）" :label="mydata.Year"></u-cell>
			<u-cell title="项目总投资金额(万元)" :label="mydata.Invest"></u-cell>
			<u-cell title="项目税费（万元）" :label="mydata.InvTax"></u-cell>
			<u-cell title="项目基本利润（万元）" :label="mydata.Profit"></u-cell>
			<u-cell title="项目基本利润率(%)" :label="mydata.ProfitRate"></u-cell>
			<u-cell title="项目建设开始时间" :label="mydata.BeginTime"></u-cell>
			<u-cell title="项目建设结束时间" :label="mydata.Initpeople"></u-cell>
			<u-cell title="各部门利润分成比例" :label="IncomeRate"></u-cell>
			<u-cell title="中标服务费" :label="mydata.InvTender"></u-cell>
			<u-cell title="设备费及线路材料费（含税）" :label="mydata.InvEqu"></u-cell>
			<u-cell title="工程施工和服务支出（含税）" :label="mydata.InvBuild"></u-cell>
			<u-cell title="收视费" :label="mydata.InvTV"></u-cell>

			<u-cell title="资源占用费" :label="mydata.InvRes"></u-cell>
			<u-cell title="税费（指增值税）" :label="mydata.InvTax"></u-cell>
			<u-cell title="验收检测费支出" :label="mydata.InvCheck"></u-cell>
			<u-cell title="设计费支出" :label="mydata.InvDesign"></u-cell>
			<u-cell title="资金占用费" :label="mydata.InvTakeMoney"></u-cell>
			<u-cell title="标书购买费" :label="mydata.InvTenderBook"></u-cell>
		</u-cell-group>
		<filelist :outid="projid"></filelist>
	</view>
</template>

<script>
	import {
		getprojlist
		
	} from '@/common/api.js'
	import filelist from "../index/c_filelist.vue"
	export default {
		components: {
		  filelist
		},
		props: {
			projid: {}
		},
		data() {
			return {

				mydata: {
					Name: '',
					Dept:{Name:''}
				}
			}
		},
		watch: {

			projid: {

				handler(newv, oldv) {
					this.getdate()

				}

			}

		},
		onLoad(option) {
			// this.buildid = option.buildid
			// if (option.buildid)

		},
		mounted() {
			this.getdate()
		},
    computed: {
      isstatus: function() {
        return this.mydata.Status == "未立项"
      },
      IncomeRate: function() {
        if (!this.mydata.IncomeRate)
          return ""
        try {
          JSON.parse(this.mydata.IncomeRate)
        } catch (e) {
          return this.mydata.IncomeRate
        }
        var r = JSON.parse(this.mydata.IncomeRate)
        if (!r)
          return r;
        var txt = ""
        r.forEach(function(v) {
          txt += v.Name + ":" + v.Value + "%;"
        })
        return txt
      }
    },
		methods: {
			showmap() {
				uni.navigateTo({
					url: 'map?buildid=' + this.buildid
				})
			},
			getdate() {
				let para = {
					Parameters: [],
				}
				para.pageIndex = 1
				para.pageSize = 20
				para.Parameters.push({
					FieldName: "Id",
					ConditionalType: "Equal",
					FieldValue: this.projid
				})
				// this.mydata={Name:'22',Addr:'',ProjInfo:{Name:''},BuildManager:""}
				getprojlist(para).then(res => {
					// this.mydata={Name:'33',Addr:'',ProjInfo:{Name:''},BuildManager:""}
					// console.log(this.data)
					this.mydata = res.data[0];
					// console.log(this.data)
				})
			}
		}
	}
</script>

<style>

</style>